﻿//添加产品选择 ---开始
//根据控件ID和是否可以多选获得产品信息
function getProductByControlId(controlId,isMutifly) {
    $("#" + controlId).ligerPopupEdit({
        grid: getGridOptions(isMutifly),//是否允许多选
        valueField: 'ID',
        textField: 'ProductName'
    });
}
function getGridOptions(checkbox) {
    var options = {
        columns: [
                         { display: 'Key', name: 'ID', type: 'text', hide: 1 },
                { display: '商品名称', name: 'ProductName', mintWidth: 80, width: 120 }, //, type: 'int', mintWidth: 40, width: 100
                {display: '商品编码', name: 'ProductCode', mintWidth: 80, width: 120 },
                { display: '商品规格', name: 'ProductStandard', mintWidth: 60, width: 80 },
                { display: '助记码', name: 'MnemonicCode', type: 'date', mintWidth: 100, width: 140 },
                { display: '计量单位', name: 'ProductUint', mintWidth: 80, width: 140 },
                { display: '销售单价(元)', name: 'SellPrice', mintWidth: 80, width: 140 },
                { display: '商品类别', name: 'TypeName', mintWidth: 80, width: 120 },
                //{ display: '状态', name: 'DeleteState', mintWidth: 80, width: 120 },
                { display: '备注', name: 'Remarks', mintWidth: 150, width: 200 }
                    ], switchPageSizeApplyComboBox: false,
        url: "../Product/GetJsonOfProducts?rand=" + Math.random(),
        method: "GET",
        pageSize: 10,
        checkbox: checkbox
    };
    return options;
}

//添加产品选择 ---结束